package com.zsk.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zsk.shop.entity.DeliveryAddress;
import com.zsk.shop.model.results.DeliveryAddressResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DeliveryAddressMapper extends BaseMapper<DeliveryAddress> {
    int deleteByPrimaryKey(Long id);

    int insertSelective(DeliveryAddress record);

    int updateByPrimaryKeySelective(DeliveryAddress record);

    @Update("UPDATE shop_delivery_address SET is_checked=0 WHERE user_no=#{userNo} AND is_checked=1")
    int updateChecked(@Param("userNo") String userNo);

    List<DeliveryAddressResult> getDeliveryAddressList(@Param("userNo") String userNo);
}